﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using AttributeRouting;
using AttributeRouting.Web.Mvc;
using PH.Model.Webs;
using PH.Logic.Webs;
namespace PH.Web.Management.Areas.Systems.Controllers
{
    [RouteArea("Systems")]
    [RoutePrefix("Web")]
    [Authorize(Roles="WebAdmin")]
    public class WebController : Controller
    {
        [Route("")]
        public ActionResult Index()
        {
            return View();
        }

        [Route("PageEdit/{id:int}")]
        public ActionResult PageEdit(int id)
        {
            var model = PageLogic.GetPage(id);
            return PartialView("Edit",model);
        }

        [Route("CreatePage/{caseID:int}")]
        public ActionResult CreatePage(int caseID)
        {
            var model = new PageModel() { CaseID = caseID };
            return PartialView("Edit",model);
        }

        [Route("Page/{caseID:int}")]
        public ActionResult Page(int caseID)
        {
            ViewBag.CaseID = caseID;
            return PartialView();
        }
    }
}
